<h2>DESCRIPTION</h2>

<em>v.in.lidar</em> converts LiDAR point clouds in LAS format to a GRASS 
vector, using the <a href="http://www.liblas.org">libLAS</a> library. 
The created vector is true 3D with x, y, z coordinates.

<p>
For larger datasets, it is recommended to not build topology (-b flag).
Also, creating a table with attributes can take some time for larger datasets.
<p>
The optional <b>spatial</b> parameter defines spatial query extents.
This parameter allows the user to restrict the region to a spatial subset
while importing the data. All LiDAR points falling into this rectangle 
subregion are imported. The <b>-r</b> current region flag is identical, 
but uses the current region settings as the spatial bounds 
(see <em><a href="g.region.html">g.region</a></em>).
<p>
A LiDAR pulse can have multiple returns. The first return values can be 
used to obtain a digital surface model (DSM) where e.g. canopy cover is 
represented. The last return values can be used to obtain a digital 
terrain model (DTM) where e.g. the forest floor instead of canopy 
cover is represented. The <b>return_filter</b> option allows selecting one of 
first, mid, or last returns.
<p>
LiDAR points can be already classified into standardized classes. For example,
class number 2 represents ground (for other classes see LAS format specification
in references). The <b>class_filter</b> option allows selecting one or more 
classes, as numbers (integers) separated by comma.

<p>
Note that proper filtering of the input points in not only critical for
the analysis itself but it can also speed up the processing
significantly.

<h3>Decimation</h3>

Table with selected percentages of points to keep with corresponding
decimation parameters:

<table class="compact">
<tr><th>percentage</th><th>parameters</th></tr>
<tr><td>0.1%</td><td>preserve=1000</td></tr>
<tr><td>1%</td><td>preserve=100</td></tr>
<tr><td>5%</td><td>preserve=20</td></tr>
<tr><td>10%</td><td>preserve=10</td></tr>
<tr><td>20%</td><td>preserve=5</td></tr>
<tr><td>25%</td><td>preserve=4</td></tr>
<tr><td>50%</td><td>skip=2</td></tr>
<tr><td>75%</td><td>skip=4</td></tr>
<tr><td>80%</td><td>skip=5</td></tr>
<tr><td>90%</td><td>skip=10</td></tr>
</table>

Table with selected fractions of points to keep with corresponding
decimation parameters:

<table class="compact">
<tr><th>ratio</th><th>parameters</th></tr>
<tr><td>1/3</td><td>preserve=3</td></tr>
<tr><td>1/4</td><td>preserve=4</td></tr>
<tr><td>1/5</td><td>preserve=5</td></tr>
<tr><td>1/6</td><td>preserve=6</td></tr>
</table>

Table with selected fractions of points to throw away with corresponding
decimation parameters:

<table class="compact">
<tr><th>ratio</th><th>parameters</th></tr>
<tr><td>1/3</td><td>skip=3</td></tr>
<tr><td>1/4</td><td>skip=4</td></tr>
<tr><td>1/5</td><td>skip=5</td></tr>
<tr><td>1/6</td><td>skip=6</td></tr>
</table>


<h2>Location Creation</h2>

<em>v.in.lidar</em> attempts to preserve projection information when importing
datasets if the source format includes projection information, and if
the LAS driver supports it.  If the projection of the source dataset does
not match the projection of the current location <em>v.in.lidar</em> will 
report an error message ("<tt>Projection of dataset does not appear to 
match current location</tt>") and then report the PROJ_INFO parameters of
the source dataset.

<p>If the user wishes to ignore the difference between the apparent coordinate
system of the source data and the current location, they may pass the 
<b>-o</b> flag to override the projection check.

<p>If the user wishes to import the data with the full projection definition,
it is possible to have <em>v.in.lidar</em> automatically create a new location based
on the projection and extents of the file being read.  This is accomplished
by passing the name to be used for the new location via the <b>location</b>
parameter.  Upon completion of the command, a new location will have been
created (with only a PERMANENT mapset), and the vector map will have been
imported with the indicated <b>output</b> name into the PERMANENT mapset.

<h2>NOTES</h2>
The typical file extensions for the LAS format are .las and .laz (compressed). 
The compressed LAS (.laz) format can be imported only if libLAS has been compiled 
with laszip support. It is also recommended to compile libLAS with GDAL, 
needed to test for matching projections.

<h2>EXAMPLE</h2>

This example is analogous to the example used in the GRASS wiki page for
<a href="https://grasswiki.osgeo.org/wiki/LIDAR#Import_LAS_as_vector_points">importing LAS as vector points</a>.
<p>The sample LAS data are in the file "Serpent Mound Model LAS Data.las", 
available at 
<a href="http://www.appliedimagery.com/downloads/sampledata/Serpent%20Mound%20Model%20LAS%20Data.las">appliedimagery.com</a>

<div class="code"><pre>
  # print LAS file info
  v.in.lidar -p input="Serpent Mound Model LAS Data.las"

  # create location with projection information of the LAS data
  v.in.lidar -i input="Serpent Mound Model LAS Data.las" location=Serpent_Mound

  # quit and restart GRASS in the newly created location "Serpent_Mound"
  # real import of LiDAR LAS data, without topology and without attribute table
  v.in.lidar -tb input="Serpent Mound Model LAS Data.las" output=Serpent_Mound_Model_pts
</pre></div>

<h2>SEE ALSO</h2>

<em>
<a href="r.in.lidar.html">r.in.lidar</a>,
<a href="r3.in.lidar.html">r3.in.lidar</a>,
<a href="g.region.html">g.region</a>,
<a href="v.vect.stats.html">v.vect.stats</a>,
<a href="v.in.ogr.html">v.in.ogr</a>
</em>

<h2>REFERENCES</h2>

<a href="https://www.asprs.org/committee-general/laser-las-file-format-exchange-activities.html">
ASPRS LAS format</a><br>
<a href="http://www.liblas.org/">LAS library</a> <br>
<a href="http://test.liblas.org/doxygen/liblas_8h.htm">LAS library C API</a> documentation

<h2>AUTHOR</h2>

Markus Metz
<br>
Vaclav Petras,
<a href="https://geospatial.ncsu.edu/geoforall/">NCSU GeoForAll Lab</a>
(decimation, cats, areas, zrange)
<br>
based on <em>v.in.ogr</em> by various authors

<!--
<p>
<i>Last changed: $Date$</i>
-->
